#ifndef _sbrush_player_h_
#define _sbrush_player_h_

namespace sbrush {
	
	enum Whence {
		Whence_Beginning,
		Whence_Current,
		Whence_End
	};
	
	class Player;
	typedef void(*player_finished_cb)(const Player* player, void* userData);

	class FinishedSignaller;
	class Player{
	public:
		Player();
		virtual ~Player() throw();
		virtual void start() = 0;
		virtual void stop() = 0;
		virtual int playHead() const = 0;
		virtual void seek(int pos, Whence whence) = 0;
		virtual int length() const = 0;
		//virtual bool isPlaying() const = 0;
		void finished() const;
		void setFinishedCallback(player_finished_cb callback, void* userData);
	private:
		FinishedSignaller* m_Signaller;
		bool m_DoSignalFinished;
		player_finished_cb m_Callback;
		void* m_UserData;
	};
}


#endif